<template>
	<!-- 调用组件 -->
	<home-header></home-header>
	 <home-swipers :swiperList='swiperList'></home-swipers>
	<home-icon :iconlist='iconlist'></home-icon>
	<home-Week :weekList='weekList'></home-Week>
	<home-Foot></home-Foot>
</template>

<script>
	//引入Header.vue
	import HomeHeader from './pages/Header'
	 import HomeSwipers from './pages/Swipers'
	import HomeIcon from './pages/Icon'
	import HomeWeek from './pages/Week'
	import HomeFoot from './pages/Foot'
	import axios from 'axios'
	
	//导出组件HomeHeader
	export default{
		components:{
			HomeHeader,
			HomeSwipers,
			 HomeIcon,
			 HomeWeek,
			 HomeFoot
		},
		data(){
			return{
				 swiperList:[],//接收Swipers组件数据
				 iconlist:[],
				 weekList:[]
			}
		},
		 mounted(){
			axios.get('./home.json').then((res)=>{
				const msg=res.data.data[0];//声明变量获取请求结果里面的数据
				//空数组获取组件数组数据
				this.swiperList=msg.swiperList;
				this.iconlist=msg.iconlist;
				this.weekList=msg.weekList;
			})
		} 
	}
</script>

<style>
</style>
